package java50practice;

import java.util.ArrayList;

public class Practice20 {
	public static void main(String[] args) {
		ArrayList<Double> fenzi = new ArrayList<>();
		ArrayList<Double> fenmu = new ArrayList<>();
		fenzi.add(2.0);
		fenmu.add(1.0);
		double sum = 0;
		for (int i = 0; i < 20; i++) {
			sum += (double) (fenzi.get(i) / fenmu.get(i));
			fenzi.add(fenzi.get(i) + fenmu.get(i));
			fenmu.add(fenzi.get(i));
		}
		System.out.println(sum);

	}
}
